package com.RedRiver.hospitalsystem.finance_service.client;

import com.RedRiver.hospitalsystem.finance_service.client.param.CreateInvoiceFromClient;
import com.RedRiver.hospitalsystem.finance_service.client.param.CreateInvoiceInfoClient;
import com.RedRiver.hospitalsystem.finance_service.client.param.FindInvoiceAllListInfoClient;
import com.RedRiver.hospitalsystem.finance_service.client.param.FindInvoicePageFromListClient;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@FeignClient(contextId = "InvoiceClient",name="finance-service",path="financeService/invoice")
public interface InvoiceClient {

    @PostMapping("/createInvoice")
    Result<CreateInvoiceInfoClient> createInvoice(@RequestBody @Valid CreateInvoiceFromClient createInvoiceFromClient);

    @PostMapping("/findInvoiceAll")
    Result<FindInvoiceAllListInfoClient> findInvoiceAll(@RequestBody FindInvoicePageFromListClient findInvoicePageFromListClient);

    @PostMapping("/changeInvoice")
    Result<CreateInvoiceInfoClient> changeInvoice(@RequestBody @Valid CreateInvoiceFromClient createInvoiceFromClient);

}
